<!DOCTYPE html>
<!-- saved from url=(0138)https://mobilelearn.chaoxing.com/page/active/stuActiveList?courseid=232647796&clazzid=72080157&cpi=207026450&ut=s&t=1677811787051&fid=9081 -->
<html lang="zh-cn"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    
    
    <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
	<meta http-equiv="Cache" content="no-cache">
	<meta http-equiv="Pragma" content="no-cache">
    <title>任务列表</title>
    <link rel="icon" href="https://mobilelearn.chaoxing.com/xinfanya/images/favicon.ico" type="image/x-icon">
    <link href="./style(1).css" type="text/css" rel="stylesheet">
    <link href="./common(1).css" type="text/css" rel="stylesheet">
    <link href="./pop(1).css" type="text/css" rel="stylesheet">
    <link href="./style(2).css" type="text/css" rel="stylesheet">
    <link href="./list.css" type="text/css" rel="stylesheet">
    <style>
        .main{min-width: 1040px;min-height: 700px;background: #FFFFFF;box-shadow: 0 2px 10px 0 rgba(237,238,240,0.50);border-radius: 8px;margin:30px}
        .popicon img{top:0px}
    </style>
    <style>
<!--
[v-cloak]{
display:none;
}
-->
</style>
<style>.clearfix:after{content: " ";display: block;height: 0px;clear: both;}</style></head>
<body style="zoom: 1; background: transparent;">

    <div id="main" class="clear" style="min-width: 1060px; overflow-x: auto;"><div class="main task-list"><div class="top-back"><h2 tabindex="16" title="21物联网0102">21物联网0102</h2></div> <div id="loadingD" style="position: absolute; top: calc(46% - 10px); left: calc(50% - 50px); display: none;"><img src="./loading2.gif"></div> <div tabindex="17" class="null-data" style="display: none;">暂无任务</div> <div class="has-content" style=""><div class="filter" style="display: none;"><span class="title">筛选</span> <span class="ipt-radio circl-choosed"><input name="group-radio" type="radio" checked="checked"><i class="icon-radio"></i></span> <div class="operate-list-group fs12 color181E33 lineheight20 inlineBlock"> 全部</div> <span class="ipt-radio circl-choosed"><input name="group-radio" type="radio"><i class="icon-radio"></i></span> <div class="operate-list-group fs12 color181E33 lineheight20 inlineBlock">已完成</div> <span class="ipt-radio circl-choosed"><input name="group-radio" type="radio"><i class="icon-radio"></i></span> <div class="operate-list-group fs12 color181E33 lineheight20 inlineBlock">未完成</div></div> <div class="bottomList"><div tabindex="18" class="status">进行中<span aria-label="0个">（0）</span></div> <ul><!----> <!----> </ul> <!----> <ul></ul> <div tabindex="19" class="status">已结束<span aria-label="7个">（7）</span></div> <ul><li tabindex="20" activeid="5000058084065" activestatus="2" activetype="2" islook="1" userstatus="1" onclick="activeRowClick(this)" onkeyup="activeRowKeyUp(this)"><!----> <!----> <!----> <!----> <!----> <!----> <!----> <div aria-label="签到" class="tag icon-signin-g"></div> <div class="right-content"><p class="overHidden2 fl" style="margin-top: 20px;">二维码签到</p> <div class="clearfix"></div> <!----></div> <!----> <div aria-label="03月03日 10时32分" class="time">
                                结束时间：03-03 10:32
                            </div> <div class="clearfix"></div></li><li tabindex="21" activeid="5000057823073" activestatus="2" activetype="2" islook="1" userstatus="1" onclick="activeRowClick(this)" onkeyup="activeRowKeyUp(this)"><!----> <!----> <!----> <!----> <!----> <!----> <!----> <div aria-label="签到" class="tag icon-signin-g"></div> <div class="right-content"><p class="overHidden2 fl" style="margin-top: 20px;">二维码签到</p> <div class="clearfix"></div> <!----></div> <!----> <div aria-label="03月01日 14时01分" class="time">
                                结束时间：03-01 14:01
                            </div> <div class="clearfix"></div></li><li tabindex="22" activeid="5000057522963" activestatus="2" activetype="2" islook="1" userstatus="1" onclick="activeRowClick(this)" onkeyup="activeRowKeyUp(this)"><!----> <!----> <!----> <!----> <!----> <!----> <!----> <div aria-label="签到" class="tag icon-signin-g"></div> <div class="right-content"><p class="overHidden2 fl" style="margin-top: 20px;">二维码签到</p> <div class="clearfix"></div> <!----></div> <!----> <div aria-label="02月27日 14时08分" class="time">
                                结束时间：02-27 14:08
                            </div> <div class="clearfix"></div></li><li tabindex="23" activeid="5000057292945" activestatus="2" activetype="2" islook="1" userstatus="1" onclick="activeRowClick(this)" onkeyup="activeRowKeyUp(this)"><!----> <!----> <!----> <!----> <!----> <!----> <!----> <div aria-label="签到" class="tag icon-signin-g"></div> <div class="right-content"><p class="overHidden2 fl" style="margin-top: 20px;">二维码签到</p> <div class="clearfix"></div> <!----></div> <!----> <div aria-label="02月24日 10时33分" class="time">
                                结束时间：02-24 10:33
                            </div> <div class="clearfix"></div></li><li tabindex="24" activeid="5000057136727" activestatus="2" activetype="2" islook="1" userstatus="1" onclick="activeRowClick(this)" onkeyup="activeRowKeyUp(this)"><!----> <!----> <!----> <!----> <!----> <!----> <!----> <div aria-label="签到" class="tag icon-signin-g"></div> <div class="right-content"><p class="overHidden2 fl" style="margin-top: 20px;">二维码签到</p> <div class="clearfix"></div> <!----></div> <!----> <div aria-label="02月22日 14时01分" class="time">
                                结束时间：02-22 14:01
                            </div> <div class="clearfix"></div></li><li tabindex="25" activeid="5000056824110" activestatus="2" activetype="2" islook="1" userstatus="1" onclick="activeRowClick(this)" onkeyup="activeRowKeyUp(this)"><!----> <!----> <!----> <!----> <!----> <!----> <!----> <div aria-label="签到" class="tag icon-signin-g"></div> <div class="right-content"><p class="overHidden2 fl" style="margin-top: 20px;">二维码签到</p> <div class="clearfix"></div> <!----></div> <!----> <div aria-label="02月20日 14时22分" class="time">
                                结束时间：02-20 14:22
                            </div> <div class="clearfix"></div></li><li tabindex="26" activeid="5000056717765" activestatus="2" activetype="2" islook="1" userstatus="1" onclick="activeRowClick(this)" onkeyup="activeRowKeyUp(this)"><!----> <!----> <!----> <!----> <!----> <!----> <!----> <div aria-label="签到" class="tag icon-signin-g"></div> <div class="right-content"><p class="overHidden2 fl" style="margin-top: 20px;">二维码签到</p> <div class="clearfix"></div> <!----></div> <!----> <div aria-label="02月17日 10时31分" class="time">
                                结束时间：02-17 10:31
                            </div> <div class="clearfix"></div></li></ul></div></div></div></div>


<script type="text/javascript" src="./jquery.min.js(1).下载"></script>
<script type="text/javascript" src="./jquery.nicescroll.min.js(1).下载"></script>
<script type="text/javascript" src="./axios-0.19.0.min.js.下载"></script>
<script type="text/javascript" src="./babel.min.js.下载"></script>
<script type="text/javascript" src="./polyfill.min.js.下载"></script>
<script type="text/javascript" src="./vue.js.下载"></script>

<!-- js文件里的国际化需要的配置文件-->
<script src="./jquery.i18n.properties.js.下载" type="text/javascript"></script>
<script src="./readproperties.js.下载" type="text/javascript"></script>

<!-- 页面国际化配置文件-->
<script type="text/javascript" src="./en_US.js.下载"></script>
    <script type="text/javascript" src="./zh_TW.js.下载"></script>
<script type="text/javascript" src="./zh_CN.js.下载"></script>
<script type="text/javascript" src="./th_TH.js.下载"></script>
<script type="text/javascript" src="./vue-i18n.js.下载"></script>
<script type="text/javascript">loadProperties();//js里的国际化需要读取旧泛雅的preoperties文件</script>

<script type="text/javascript" src="./pop.js.下载"></script>
<script type="text/javascript" src="./poplayout.js.下载"></script>
<script type="text/javascript" src="./select.js.下载"></script>
<script type="text/javascript" src="./common.js(2).下载"></script>
<script type="text/javascript" src="./xlPaging.js.下载"></script>
<script type="text/javascript" src="./serviceDomainScript"></script>
<script type="text/javascript">
/*<![CDATA[*/
document.domain = document.domain.replace(document.domain.substring(0,document.domain.indexOf(".")+1),"");
var fid = "9081";
var courseId = "232647796";
var classId = "72080157";
var cpi = "207026450";
var showNotStartedActive = 0;
var _loginInfo_ = {"uid":199495223,"fid":9081,"role":"3","dxfid":8478,"time":"2023-03-03 10:49:26","vc3":"K7EX9k7N3hL9JMWqrd2w8HFr7jLD7meTB47ilXFAXJre3Fw2JxHrxzvIhKRiHYbhGRypvb++UvM40N68xzSjyiONzUSZ1stgv10RgODO3s3w\/znfTiBAehk6Z5Ynw1EvlyHQm7PFS8AaGbmQghGAumQ9W\/C7tf2fKqYsx8mWtZE=df12a9d13383c4aa1094e4f3c7928081","vc":null,"_rs":1677811766423};
var puid = _loginInfo_.uid;
var timetable = 0;
var readingDuration=""
var from = ""
var ext=""
var messages = {
    zh_CN: {language: zhLanguage},
    en_US: {language: enLanguage},
        th_TH: {language: thLanguage},
        zh_TW: {language: zhTWLanguage},
}
var i18n = new VueI18n({
    locale: languageCookieFuc("browserLocale"), // 语言标识
        messages: messages
    });
var initTabIndex=0;
var app = new Vue({
	el: '#main',
    i18n:i18n,
	data: {
		classObj: {},	//班级详情
		activeList: [],
		activeList1: [],
		activeList2: [],
		activeList0: [],
		timetable: timetable,
		topicIconUrl: '',
		workIconUrl: ''
	},
	mounted: function() {
		if(!fid||!courseId||!classId){
            //参数缺失
            $.toast({type:"failure",content:$.i18n.prop("language.parameters")});
			return;
		}
		if(!_loginInfo_){
            //请登录后再试
            $.toast({type:"failure",content:$.i18n.prop("language.logIn")});
			return;
		}
		this.loadClassInfo();
		//console.log("loadActiveList");
		this.loadActiveList();
		try{
			if(parent.location.href.indexOf("kb."+document.domain)>=0){
				//课表嵌套页面
				this.timetable=1;
			}
		}catch(expp){}

		if(this.timetable==1){
			this.getTopicAndWorkUrl();
		}
	},
	computed:{
    	curTabIndex:function(){
    		return function(){
                initTabIndex+=1;
        		return initTabIndex;
    		}
    	}
    },
	methods: {
		//加载班级信息
		loadClassInfo: function(){
			var _this=this;
			axios.get('/v2/apis/class/getClassDetail',{
					params: {
				  		fid : fid,
				  		courseId : courseId,
				  		classId : classId
					}
			  	})
			  	.then(function(response){
			  		console.log(response);
			  		if(response.data.result==1){
			  			_this.classObj=response.data.data;
			  		}else{
			  			$.toast({type:"failure",content:response.data.errorMsg});
			  		}
			  	}).catch(function (error) { // 请求失败处理
			  		console.log(error);
			  		$.toast({type:"failure",content:""+$.i18n.prop("language.theSystemIsBusy")});/*系统繁忙，请稍后再试*/
			  	}
			);
		},
		//加载活动列表
		loadActiveList: function(){
			$("#loadingD").show();
			var _this=this;
			//console.log("axios.get");
			//console.log("fid"+fid+",courseId"+courseId+",classId"+classId);
            $.ajax({
                url: "/v2/apis/active/student/activelist",
                type: "GET",
                async:'false',
                data: {
                    "fid":fid,
                    "courseId":courseId,
                    "classId":classId,
                    "showNotStartedActive":showNotStartedActive
                },
                cache:false,
                success:function(data){
                    //$.loading.end();
                    $("#loadingD").hide();
                    //console.log("then");
                    console.log(data);
                    if(data.result==1){
                        $("#loadingD").hide();
                        if(!data.data.activeList || data.data.activeList.length==0){
                            if(_this.timetable==1){
                                $(".has-content").show();
                            }else{
                                $(".null-data").show();
                            }
                        }else{
                            //_this.activeList=response.data.data.activeList;
                            // console.log("data.data.activeList: ", data.data.activeList)
                            for(j=0;j<data.data.activeList.length;j++){
                                var g=data.data.activeList[j];
                                _this.activeList.push(g);
                                if (!!g.status && g.status == 1) {
                                    _this.activeList1.push(g);
                                } else if(!!g.status && g.status == 2){
                                    _this.activeList2.push(g);
                                } else {
                                    _this.activeList0.push(g);
                                }
                            }
                            // console.log("_this.activeList1: ", _this.activeList1)
                            _this.$nextTick(function(){
                                //该段代码使得没有副标题的活动在所在行能够垂直居中
                                $(".bottomList ul li").each(function () {
                                    var PLHeight = $(this).find(".right-content p.status").height();
                                    var PHeight = $(this).find(".right-content p:first-child").height();
                                    if(PLHeight==null){
                                        var marginTop = (40-PHeight)/2
                                        $(this).find(".right-content p:first-child").css("margin-top",marginTop+"px");
                                    }
                                });
                            });
                            $(".has-content").show();
                        }
                        readingDuration=data.data.readingDuration
                        if (readingDuration>0){//开关控制是否支持传入参数用于统计阅读时长
                            ext = data.data.ext
                            from = data.data.ext._from_
                        }

                    }else{
                        $.toast({type:"failure",content:data.errorMsg});
                    }
                },
                error:function () {
                    $.loading.end();
                    $("#loadingD").hide();
                    $.toast({type:"failure",content:""+$.i18n.prop("language.theSystemIsBusy")});/*系统繁忙，请稍后再试*/
                }
            });
            //ie不发请求
			// axios.get('/v2/apis/active/student/activelist',{
			// 		params: {
			// 	  		fid : fid,
			// 	  		courseId : courseId,
			// 	  		classId : classId
			// 		}
			//   	})
			//   	.then(function(response){
			//   		//$.loading.end();
			//   		$("#loadingD").hide();
            //         console.log("then");
			//   		console.log(response);
			//   		if(response.data.result==1){
			//   			$("#loadingD").hide();
			//   			if(!response.data.data.activeList || response.data.data.activeList.length==0){
			//   				if(_this.timetable==1){
			//   					$(".has-content").show();
			//   				}else{
			//   					$(".null-data").show();
			//   				}
			//   			}else{
			//   				//_this.activeList=response.data.data.activeList;
			//   				for(j=0;j<response.data.data.activeList.length;j++){
			// 	  				var g=response.data.data.activeList[j];
			// 	  				_this.activeList.push(g);
			// 	  				if (!!g.status && g.status == 1) {
            //                         _this.activeList1.push(g);
            //                     } else {
            //                         _this.activeList2.push(g);
            //                     }
			// 	  			}
			//   				_this.$nextTick(function(){
			//   					//该段代码使得没有副标题的活动在所在行能够垂直居中
			//   					$(".bottomList ul li").each(function () {
			//   			            var PLHeight = $(this).find(".right-content p.status").height();
			//   			            var PHeight = $(this).find(".right-content p:first-child").height();
			//   			            if(PLHeight==null){
			//   			                var marginTop = (40-PHeight)/2
			//   			                $(this).find(".right-content p:first-child").css("margin-top",marginTop+"px");
			//   			            }
			//   			        });
			//   				});
			//   				$(".has-content").show();
			//   			}
			//   		}else{
			//   			$.toast({type:"failure",content:response.data.errorMsg});
			//   		}
			//   	}).catch(function (error) { // 请求失败处理
			//   		//$.loading.end();
			//   		$("#loadingD").hide();
			//   		console.log(error);
			//   		$.toast({type:"failure",content:""+$.i18n.prop("language.theSystemIsBusy")});/*系统繁忙，请稍后再试*/
			//   	}
			// );
		},
		getTopicAndWorkUrl: function(){
			var _this=this;
			axios.get('/v2/apis/class/getTopicAndWorkUrl?DB_STRATEGY=DEFAULT',{
					params: {
						fid : fid,
						courseId: courseId,
						classId: classId,
						cpi: cpi
					}
			  	})
			  	.then(function(response){
			  		console.log(response);
			  		if(response.data.result==1){
			  			_this.topicIconUrl=response.data.data.topicUrl;
			  			_this.workIconUrl=response.data.data.workUrl;
			  		}
			  	}).catch(function (error) { // 请求失败处理
			  		console.log(error);
			  		$.toast({type:"failure",content:""+$.i18n.prop("language.theSystemIsBusy")});/*系统繁忙，请稍后再试*/
			  	}
			);
		},
		//设置已读
		updateIsLook: function(activeId){
			var _this=this;
			axios.get('/ppt/taskAPI/updateIsLook',{
					params: {
						activeId : activeId,
						uid: puid
					}
			  	})
			  	.then(function(response){
			  		//$.loading.end();
			  		console.log(response);
			  		if(response.data.status!=1){
			  			//$.toast({type:"failure",content:"设置已读失败"});
			  			console.log("设置已读失败");
			  		}else{
			  			console.log("设置已读成功");
			  			//$(dom).find(".tag .redtips").remove();
			  			var active=_this.getActiveFromActiveList(activeId);
			  			if(active!=null){
			  				active.isLook=1;
			  			}
			  		}
			  	}).catch(function (error) { // 请求失败处理
			  		console.log(error);
			  		$.toast({type:"failure",content:""+$.i18n.prop("language.theSystemIsBusy")});/*系统繁忙，请稍后再试*/
			  	}
			);
		},
		//从数组中找到指定活动对应的vue元素，以便做出改变
		getActiveFromActiveList: function(activeId){
			var _this=this;
			for(j=0;j<_this.activeList.length;j++){
  				var active=_this.activeList[j];
  				if(active.id==activeId){
  					return active;
  				}
  			}
			return null;
		},
        timeFormate: function (status,startTime,endTime) {//时间毫秒数转换为时间格式
            var date = new Date(startTime);
            if (status==1){
                if(!startTime||startTime==""){
                    return "";
                }
                date = new Date(startTime);
            }else{
                if(!endTime||endTime==""){
                    return "";
                }
                date = new Date(endTime);
            }
            var year=date.getFullYear();
            var currentYear=new Date().getFullYear();
            if(year==currentYear){
                //本年的不显示年份
                return dateFormat("MM-dd HH:mm",date);
            }else{
                return dateFormat("yyyy-MM-dd HH:mm",date);
            }
        },
        timeFormate2: function (status,startTime,endTime) {//时间毫秒数转换为时间格式
            var date = new Date(startTime);
            if (status==1){
                if(!startTime||startTime==""){
                    return "";
                }
                date = new Date(startTime);
            }else{
                if(!endTime||endTime==""){
                    return "";
                }
                date = new Date(endTime);
            }
            var year=date.getFullYear();
            var currentYear=new Date().getFullYear();
            if(year==currentYear){
                //本年的不显示年份
                return dateFormat("MM月dd日 HH时mm分",date);
            }else{
                return dateFormat("yyyy年MM月dd日 HH时mm分",date);
            }
        }
	},
	filters: {
		timeFormate: function (status,startTime,endTime) {//时间毫秒数转换为时间格式
			var date = new Date(startTime);
			if (status==1){
				if(!startTime||startTime==""){
					return "";
				}
				date = new Date(startTime);
			}else{
				if(!endTime||endTime==""){
					return "";
				}
				date = new Date(endTime);
			}
			var year=date.getFullYear();
			var currentYear=new Date().getFullYear();
			if(year==currentYear){
				//本年的不显示年份
				return dateFormat("MM-dd HH:mm",date);
			}else{
				return dateFormat("yyyy-MM-dd HH:mm",date);
			}
		},
        timeFormate2: function (status,startTime,endTime) {//时间毫秒数转换为时间格式
            var date = new Date(startTime);
            if (status==1){
                if(!startTime||startTime==""){
                    return "";
                }
                date = new Date(startTime);
            }else{
                if(!endTime||endTime==""){
                    return "";
                }
                date = new Date(endTime);
            }
            var year=date.getFullYear();
            var currentYear=new Date().getFullYear();
            if(year==currentYear){
                //本年的不显示年份
                return dateFormat("MM月dd日 HH时mm分",date);
            }else{
                return dateFormat("yyyy年MM月dd日 HH时mm分",date);
            }
        },
		getFileSize :function(obj) {//文件大小转换
			return setFileSize(obj);
		}
	}
});

function dateFormat(fmt, date) {
    var ret;
    var opt = {
        "yyyy": date.getFullYear().toString(),        // 年
        "MM": (date.getMonth() + 1).toString(),     // 月
        "dd": date.getDate().toString(),            // 日
        "HH": date.getHours().toString(),           // 时
        "mm": date.getMinutes().toString(),         // 分
        "ss": date.getSeconds().toString()          // 秒
        // 有其他格式化字符需求可以继续添加，必须转化成字符串
    };
    for (var k in opt) {
        ret = new RegExp("(" + k + ")").exec(fmt);
        if (ret) {
            fmt = fmt.replace(ret[1], (ret[1].length == 1) ? (opt[k]) : (opt[k].padStart(ret[1].length, "0")))
        };
    };
    return fmt;
}

//打开通知
function openNotice(noticeId){
	axios.get('/v2/apis/notice/getUuid',{
			params: {
				noticeId : noticeId
			}
	  	})
	  	.then(function(response){
	  		//$.loading.end();
	  		console.log(response);
	  		if(response.data.result==1){
                var domain = document.domain;
                //var noticeDomain = 'https://notice.chaoxing.com'
                //if (domain.indexOf('ecourse.ucas.ac.cn') > -1) {
                //    noticeDomain = 'http://notice.ecourse.ucas.ac.cn'
                //}
                var url = "//"+ ServiceDomain.noticeDomain + "/pc/course/notice/"+response.data.data+"/detail"
                window.open(url);
	  			//window.open("https://notice.chaoxing.com/pc/course/notice/"+response.data.data+"/detail");
	  		}else{
	  			$.toast({type:"failure",content:response.data.errorMsg});
	  		}
	  	}).catch(function (error) { // 请求失败处理
	  		console.log(error);
	  		$.toast({type:"failure",content:""+$.i18n.prop("language.theSystemIsBusy")});/*系统繁忙，请稍后再试*/
	  	}
	);
}

//打开主题讨论
function openDiscuss(activeId){
    if(/Apple/.test(navigator.vendor)){
        //解决苹果safari浏览器在回调函数中无法执行window.open的问题
        var newWindow=window.open("","_blank");
        $.ajax({
            url: "/v2/apis/discuss/getTopicDiscussInfo",
            dataType:"json",
            async:'false',
            data: {"activeId":activeId},
            success:function(data){
                if (data.result == 1) {
                    var domain = document.domain;
                    var discussDomain = ServiceDomain.groupwebDomainWithProtocol;
                    if(data.data.groupwebDomain){
                        discussDomain=data.data.groupwebDomain;
                    }
                    if (domain.indexOf('ecourse.ucas.ac.cn') > -1) {
                        discussDomain = 'http://groupweb.ecourse.ucas.ac.cn'
                    }
                    var url = discussDomain +"/course/topicDiscuss/info?uuid=" + data.data.uuid
                        + "&activeId=" + data.data.activeId + "&startTime=" + data.data.startTime + "&timeLong=" + data.data.timeLong
                        + "&activeStatus=" + data.data.activeStatus + "&courseId=" + courseId;
                    setTimeout(function(){
                        newWindow.location.href=url;
                    },100);
                }else if (data.result == 0) {
                    $.toast({type:"failure", content: data.errorMsg});
                }
            }
        });
    }else{
        $.ajax({
            url: "/v2/apis/discuss/getTopicDiscussInfo",
            dataType:"json",
            async:'false',
            data: {"activeId":activeId},
            success:function(data){
                if (data.result == 1) {
                    var domain = document.domain;
                    var discussDomain = ServiceDomain.groupwebDomainWithProtocol;
                    if(data.data.groupwebDomain){
                        discussDomain=data.data.groupwebDomain;
                    }
                    if (domain.indexOf('ecourse.ucas.ac.cn') > -1) {
                        discussDomain = 'http://groupweb.ecourse.ucas.ac.cn'
                    }
                    var url = discussDomain +"/course/topicDiscuss/info?uuid=" + data.data.uuid
                        + "&activeId=" + data.data.activeId + "&startTime=" + data.data.startTime + "&timeLong=" + data.data.timeLong
                        + "&activeStatus=" + data.data.activeStatus + "&courseId=" + courseId;
                    window.open(url)
                }else if (data.result == 0) {
                    $.toast({type:"failure", content: data.errorMsg});
                }
            }
        });
    }

}

//点击活动，打开活动详情页
function activeRowClick(dom){
	var activeId=$(dom).attr("activeId");
	var activeType=$(dom).attr("activeType");
	var activeStatus=$(dom).attr("activeStatus");
	var isLook=$(dom).attr("isLook");
	var userStatus=$(dom).attr("userStatus");
    var signCode=$(dom).attr("signCode");

    if(activeStatus==0){
    	$.toast({type:"warning", content: $.i18n.prop("language.activityNotStarted")});
    	return;
    }

	if(!isLook||isLook!=1){
		//设置已读
		app.updateIsLook(activeId);
	}
	console.log("打开活动详情页：activeId= "+ activeId +", activeType= "+ activeType +", activeStatus= "+ activeStatus +", userStatus= "+ userStatus);
	switch(activeType){
		case '2':	//签到
            window.location.href = "/page/sign/signIn?courseId="+courseId+"&classId="+classId+"&activeId="+activeId+"&fid="+fid
			break;
        case '56':	//在线课堂
            var url = ServiceDomain.superClassDomainWithProtocol+ "/app/meet/index?courseId="+courseId+"&classId="+classId+"&uuid="+classId+"&inviteCode="+signCode+"&v=v2";
            window.open(url);
            break;
		case '5':	//主题讨论
			openDiscuss(activeId);
			break;
        case '50':	// 主题讨论
            // location.href = "/page/topicDiscuss/reply_discuss?courseId="+courseId+"&classId="+classId+"&activeId="+activeId+"&fid="+fid+"&cpi="+cpi+"&showOnScreenShare=true";
            var url = "/page/topicDiscuss/student/stu_reply_discuss?courseId="+courseId+"&classId="+classId+"&activeId="+activeId+"&fid="+fid+"&cpi="+cpi+"&showOnScreenShare=true";
            window.open(url);
            break;
		case '17':	//直播
			var liveId=$(dom).find(".liveId").val();
			if(!!liveId){
				//window.open("https://zhibo.chaoxing.com/"+liveId);
				openLivePage(liveId);
			}
			break;
        case '35':	//分组任务
            axios.get('/v2/apis/taskStu/getActiveInfoForMe',{
                params: {
                    fid : fid,
                    courseId : courseId,
                    activeId : activeId
                }
            }).then(function(response){
                //$.loading.end();
                $("#loadingD").hide();
                console.log(response);
                if(response.data.result==1){
                    var isNorm = response.data.data.isNorm;
                    var toAnswerPage =response.data.data.toAnswerPage;
                    var notInClass = response.data.data.notInClass;
                    var useNoteEditor = response.data.data.useNoteEditor;
                    var isDelete = response.data.data.isDelete;
                    if(isDelete!=null&&isDelete!=undefined&&isDelete==1){
                        //任务已删除
                        $.toast({type:"failure",content:"分组任务已删除"});
                        return;
                    }
                    if(notInClass==1){//任务发放时不在班级
                        //任务发放时您未加入班级
                        $.toast({type:"failure",content:$.i18n.prop("language.notInTheClass")});
                        return;
                    }
                    var url = "";
                    if(isNorm==1){//分组的
                        if(useNoteEditor==1){
                            if(toAnswerPage==1){
                                url = '/page/renwuNew/stu/taskDetailStuForAnswer_new?activeId='+activeId+'&courseId='+courseId+"&classId="+classId+"&fid="+fid;
                            }else{
                                url='/page/renwuNew/stu/taskDetailStuAndAnsDetail_new?courseId='+courseId+'&classId='+classId+'&activeId='+activeId+'&fid='+fid;
                            }
                        }else{
                            if(toAnswerPage==1){
                                url = '/page/renwu/stu/taskDetailStuForAnswer?activeId='+activeId+'&courseId='+courseId+"&classId="+classId+"&fid="+fid;
                            }else{
                                url='/page/renwu/stu/taskDetailStuAndAnsDetail?courseId='+courseId+'&classId='+classId+'&activeId='+activeId+'&fid='+fid;
                            }
                        }
                    }else{
                        if(useNoteEditor==1) {
                            if (toAnswerPage == 1) {
                                url = '/page/renwuNew/notGroup/taskDetailStuForAnswerNotGroup_new?courseId=' + courseId + '&classId=' + classId + '&activeId=' + activeId + '&fid=' + fid
                            } else {
                                url = '/page/renwuNew/notGroup/taskDetailStuAndAnsDetailNotGroup_new?courseId=' + courseId + '&classId=' + classId + '&activeId=' + activeId + '&fid=' + fid
                            }
                        }else{
                            if (toAnswerPage == 1) {
                                url = '/page/renwu/notGroup/taskDetailStuForAnswerNotGroup?courseId=' + courseId + '&classId=' + classId + '&activeId=' + activeId + '&fid=' + fid
                            } else {
                                url = '/page/renwu/notGroup/taskDetailStuAndAnsDetailNotGroup?courseId=' + courseId + '&classId=' + classId + '&activeId=' + activeId + '&fid=' + fid
                            }
                        }
                    }
                    window.location.href = url;
                }else{
                    $.toast({type:"failure",content:response.data.errorMsg});
                }
            }).catch(function (error) { // 请求失败处理
                    console.log(error);
                    $.toast({type:"failure",content:""+$.i18n.prop("language.theSystemIsBusy")});/*系统繁忙，请稍后再试*/
                }
            );
            break;
		case '45':	//通知
			var noticeId=$(dom).find(".noticeId").val();
			var content=$(dom).attr("content");
			console.log(">>"+content);
			if(!!noticeId){
				var idCode=null;
				var content=$(dom).attr("content");
				if(!!content&&content!=''){
					var contentJson = eval('('+content+')')
					if(!!contentJson.idCode){
						idCode = contentJson.idCode;
					}
				}
				if(idCode!=null){
					var url = "//"+ServiceDomain.noticeDomain+ "/pc/course/notice/"+idCode+"/detail"
					window.open(url);
				}else{
					openNotice(noticeId);
				}
			}
			break;
        case '14'://问卷
        case '42'://测验
            var url = "/page/quiz/stu/answerQuestion?courseId="+courseId+"&classId="+classId+"&activeId="+activeId+"&fid="+fid;
            window.location.href = url;
            break;
        case '43'://投票
            var url = "/page/qvote/stu/answerQvote?courseId="+courseId+"&classId="+classId+"&activeId="+activeId+"&fid="+fid;
            window.location.href = url;
            break;
        case '11'://选人
            var url = "/page/selectperson/stuSelectPerson?courseId="+courseId+"&classId="+classId+"&activeId="+activeId+"&fid="+fid;
            window.location.href = url;
            break;
        case '49'://白板
            window.open("/page/whiteboard/stuWhiteBoard?courseId="+courseId+"&classId="+classId+"&activeId="+activeId+"&fid="+fid);
            break;
        case '4'://抢答
            var url = "/page/answer/stuAnswer?courseId="+courseId+"&classId="+classId+"&activeId="+activeId+"&fid="+fid;
            window.location.href = url;
            break;
        case '23'://评分
            var url = "/page/score/stuScoreAnswer?courseId="+courseId+"&classId="+classId+"&activeId="+activeId+"&fid="+fid+"&userStatus="+userStatus;
            window.location.href = url;
            break;
        case '46'://学生反馈
            $.ajax({
                url: "/v2/apis/feedback/getFeedbackInfo",
                dataType:"json",
                async:'false',
                data: {"activeId":activeId},
                success:function(data){
                    if (data.result == 1) {
                        var url = data.data.screenUrl;
                        window.location.href = url;
                    }
                }
            });
            break;
        case '48'://章节
            var chapterId = $(dom).find(".chapterId").val();
            if(!chapterId) {
               return
            }
            if(/Apple/.test(navigator.vendor)) {
                //解决苹果safari浏览器在回调函数中无法执行window.open的问题
                var newWindow = window.open("", "_blank");
                $.ajax({
                    url: '/v2/apis/chapter/getChapterUrl?DB_STRATEGY=RANDOM',
                    data: {'courseId': courseId, 'classId': classId, 'chapterId': chapterId},
                    type: "get",
                    async: 'false',
                    cache: false,
                    success: function (data) {
                        if (data.result == 1) {
                            var url = data.data.url;
                            if (!url) {
                                return;
                            }
                            if (!!cpi) {
                                url += "&cpi=" + cpi
                            }
                            setTimeout(function(){
                                newWindow.location.href=url;
                            },100);
                        }
                    },
                    error: function (e) {
                        console.log(e)
                    }
                })
            }else{
                $.ajax({
                    url: '/v2/apis/chapter/getChapterUrl?DB_STRATEGY=RANDOM',
                    data: {'courseId': courseId, 'classId': classId, 'chapterId': chapterId},
                    type: "get",
                    async: 'false',
                    cache: false,
                    success: function (data) {
                        if (data.result == 1) {
                            var url = data.data.url;
                            if (!url) {
                                return;
                            }
                            if (!!cpi) {
                                url += "&cpi=" + cpi
                            }
                            window.open(url);
                        }
                    },
                    error: function (e) {
                        console.log(e)
                    }
                })
            }
            break;
        case '57':
            var teachPlanId = $(dom).find(".teachPlanId").val();
            if(/Apple/.test(navigator.vendor)) {
                //解决苹果safari浏览器在回调函数中无法执行window.open的问题
                var newWindow = window.open("", "_blank");
                $.ajax({
                    url: "/v2/apis/ppt/getPptInfo",
                    dataType: "json",
                    data: {"activeId": teachPlanId},
                    async: 'false',
                    success: function (data) {
                        if (data.result == 1) {
                            if (!!data.data && !!data.data.objectId) {
                                var url = "//" + ServiceDomain.cloudDomain + "/screen/file_" + data.data.objectId;
                                setTimeout(function(){
                                    newWindow.location.href=url;
                                },100);
                            }
                        }
                    }
                });
            }else{
                $.ajax({
                    url: "/v2/apis/ppt/getPptInfo",
                    dataType: "json",
                    data: {"activeId": teachPlanId},
                    async: 'false',
                    success: function (data) {
                        if (data.result == 1) {
                            if (!!data.data && !!data.data.objectId) {
                                var url = "//" + ServiceDomain.cloudDomain + "/screen/file_" + data.data.objectId;
                                window.open(url)
                            }
                        }
                    }
                });
            }
            break;
        case '58':
            var teachPlanId = $(dom).find(".teachPlanId").val();
            var url = "/page/ppt/stuTeachingplan?teachingPlanId=" + teachPlanId + "&classId=" + classId + "&fid=" + fid + "&courseId=" + courseId;
            window.open(url)
            break;
        case '60':
            if(activeStatus == 2){
                $.toast({type:"failure",content:""+$.i18n.prop("language.ended")});/* 教案已结束*/
            }else{
                var teachPlanId = $(dom).find(".teachPlanId").val();
                var url = "/page/ppt/stuTeachingplanV2?teachingPlanId=" + teachPlanId + "&classId=" + classId + "&fid=" + fid + "&courseId=" + courseId +"&activeId="+activeId;
                window.open(url);
            }
            break;
        case '44'://资源型活动打开
            readResourceActive(dom);
            break;
        case '51': //查看同步课堂

            if (activeStatus != 2) {
                if(/Apple/.test(navigator.vendor)) {
                    //解决苹果safari浏览器在回调函数中无法执行window.open的问题
                    var newWindow = window.open("", "_blank");
                    $.ajax({
                        url: "/widget/screenClassroom/getSyncByActiveId?DB_STRATEGY=DEFAULT",
                        type: "post",
                        dataType: "json",
                        async: 'false',
                        data: {"activeId": activeId},
                        success: function (obj) {
                            if (obj.result == 1) {
                                var code = obj.data.inviteCode;
                                var url = ServiceDomain.xxtClassDomainWithProtocol + "/" + code;
                                setTimeout(function () {
                                    newWindow.location.href = url;
                                }, 100);
                            }
                        }
                    });
                }else{
                    $.ajax({
                        url: "/widget/screenClassroom/getSyncByActiveId?DB_STRATEGY=DEFAULT",
                        type: "post",
                        dataType: "json",
                        async: 'false',
                        data: {"activeId": activeId},
                        success: function (obj) {
                            if (obj.result == 1) {
                                var code = obj.data.inviteCode;
                                var url = ServiceDomain.xxtClassDomainWithProtocol + "/" + code;
                                window.open(url)
                            }
                        }
                    });
                }
            } else {
                var otherId = $(dom).find(".otherId").val();
                if(/Apple/.test(navigator.vendor)) {
                    //解决苹果safari浏览器在回调函数中无法执行window.open的问题
                    var newWindow = window.open("", "_blank");
                    $.ajax({
                        url: "/widget/coursewareCommon/getClassroomPlanById?DB_STRATEGY=PRIMARY_KEY&STRATEGY_PARA=pptId",
                        type: "post",
                        dataType: "json",
                        async: 'false',
                        data: {"pptId": otherId},
                        success: function (obj) {
                            if (obj.result == 1) {
                                var des = obj.data.des;
                                var extinfo = eval('(' + des + ')')
                                var objId = extinfo.objectId;
                                var url = "//" + ServiceDomain.cloudDomain + "/screen/file_" + objId;
                                setTimeout(function () {
                                    newWindow.location.href = url;
                                }, 100);
                            }
                        }
                    });
                }else{
                    $.ajax({
                        url: "/widget/coursewareCommon/getClassroomPlanById?DB_STRATEGY=PRIMARY_KEY&STRATEGY_PARA=pptId",
                        type: "post",
                        dataType: "json",
                        async: 'false',
                        data: {"pptId": otherId},
                        success: function (obj) {
                            if (obj.result == 1) {
                                var des = obj.data.des;
                                var extinfo = eval('(' + des + ')')
                                var objId = extinfo.objectId;
                                var url = "//" + ServiceDomain.cloudDomain + "/screen/file_" + objId;
                                window.open(url)
                            }
                        }
                    });
                }


            }
            break;
        case '61':	//word活动查看
            var content=$(dom).attr("content");
            if(!!content&&content!=''){
                var contentJson = eval('('+content+')')
                var obj = contentJson.pptObjectId;
                var url = ServiceDomain.cloudDomainWithProtocol+"/screen/file_" + obj;
                window.open(url)
            }
            break;

        case '62':	//pdf活动查看
            var content=$(dom).attr("content");
            if(!!content&&content!=''){
                var contentJson = eval('('+content+')')
                var obj = contentJson.pptObjectId;
                var url = ServiceDomain.cloudDomainWithProtocol+"/screen/file_" + obj;
                window.open(url)
            }
            break;
        case '63':	//外部网页活动
            var content=$(dom).attr("content");
            if(!!content&&content!=''){
                var contentJson = eval('('+content+')')
                var url = contentJson.stuUrl;
                window.open(url)
            }
            break;
        case '64': //腾讯会议
            var content=$(dom).attr("content");
            if(!!content&&content!=''){
                var contentJson = eval('('+content+')')
                var url = contentJson.stuUrl;
                $.ajax({
                    url: "/v2/apis/tencentMeeting/getdesEncrypt?DB_STRATEGY=COURSEID&STRATEGY_PARA=courseId",
                    dataType:"json",
                    async:'false',
                    data: {
                        courseId : courseId
                    },
                    success:function(data){
                        if (data.result == 1) {
                            var enc=data.data.enc;
                            if(url.indexOf("?")>0){
                                url=url+"&enc="+enc;
                            }else{
                                url=url+"?enc="+enc;
                            }
                            window.open(url)
                        }else{
                            jsBridge.postNotification('CLIENT_DISPLAY_MESSAGE', {'message':$.i18n.prop("language.operationfailedAndTry")}) ;//操作失败，请稍后重试
                        }
                    }
                })
            }
            break;
        case '68'://测验
            var url = "/page/interactivepractice/stu/answerQu?courseId="+courseId+"&classId="+classId+"&activeId="+activeId+"&fid="+fid;
            window.location.href = url;
            break;
        default:
			var content=$(dom).attr("content");
			if(!!content&&content!=''){
				var contentJson = eval('('+content+')')
				var url = contentJson.stuUrl;
				window.open(url)
			}
			break;
    }
}

function readResourceActive(dom) {
    var data=$(dom).attr("content");
    if (!data) {
        return;
    }
    if (typeof(data)=="string"){
        data = eval('(' + data + ')');
    }
    if (!data.resourceData) {
        return;
    }
    var resourceData = data.resourceData;
    if (typeof(resourceData)=="string"){
        resourceData = eval('(' + resourceData + ')');
    }
    var content = resourceData.content;
    if (typeof(content)=="string"){
        content = eval('(' + content + ')');
    }
    var url = "";
    if (data.resourceType=="1001"||data.resourceType=="1002"
        ||data.resourceType=="1006"||data.resourceType=="1007") {//文档
        var objId = content.objectId;
        url = "//"+ ServiceDomain.cloudDomain +"/screen/file_" + objId
        //开关控制是否支持传入参数用于统计阅读时长
        if (readingDuration>0){
            url = "//"+ ServiceDomain.cloudDomain +"/screen/file_" + objId+"?ext="+encodeURIComponent(JSON.stringify(ext));
        }

    }else if (data.resourceType=="1003"){//图片
        var objId = content.objectId;
        url=ServiceDomain.picDomainWithProtocol+'/star3/origin/'+ objId +'.'+content.suffix;
    } else if (data.resourceType=="1004"){//视频
        var resid = content.resid;
        if(typeof(resid)=="undefined"){
            resid = "";
        }
        var objId = content.objectId;
        //获取视频地址
        $.ajax({
            url: '/widget/coursewareChileActive/getVideoPath?objectId=' + objId + '&resid=' + resid + '&uid=' + _loginInfo_.uid,
            type: "get",
            async:false,
            success: function (result) {
                url = result.data;
            }
        })
    }else if (data.resourceType=="1005"){//音频
        var objId = content.objectId;
        //获取视频地址
        $.ajax({
            url: '/widget/coursewareChileActive/getVideoOrVoiceAddress?objectId=' + objId + '&resid=' + resid + '&uid=' + _loginInfo_.uid+'&mimeType=4',
            type: "get",
            async:false,
            success: function (result) {
                url = result.data;
            }
        })

    }else if (data.resourceType=="1"){//专题
        if (!!content.aid && content.aid.indexOf('mooc_') > -1) {
            var aid = content.aid.substring(5);
            url = ServiceDomain.moocKnowledgeDomainWithProtocol+"/course/" + aid+".html";
            if (readingDuration>0){
                url = ServiceDomain.moocKnowledgeDomainWithProtocol+"/course/" + aid+".html"+"?_from_="+from;
            }
        }else if (!!content.appurl) {
            url = content.appurl;
            if (readingDuration>0){
                url = content.appurl+"?ext="+encodeURIComponent(JSON.stringify(ext));
            }
        }else if (!!content.sourceConfig && !!content.sourceConfig.chapterId && content.sourceConfig.id) {
            url = ServiceDomain.moocKnowledgeDomainWithProtocol+"/ztnodedetailcontroller/visitnodedetail?courseId="+ content.sourceConfig.id +"&knowledgeId="
                + content.sourceConfig.chapterId +"&_from_=&rtag=";
            if (readingDuration>0){
                url = ServiceDomain.moocKnowledgeDomainWithProtocol+"/ztnodedetailcontroller/visitnodedetail?courseId="+ content.sourceConfig.id +"&knowledgeId="
                    + content.sourceConfig.chapterId +"&_from_="+from+"&rtag=";
            }
        }
    }else if (data.resourceType=="3"){//话题
        if (!!content.shareUrl) {
            url = content.shareUrl
        }
    }else if (data.resourceType=="4"){//笔记
        var cid = content.cid;
        //url = ServiceDomain.noteDomainWithProtocol+"/screen/note_note/noteDetail/" + cid;
        url = ServiceDomain.noteDomainWithProtocol+"/pc/note_note/noteDetailLatest/" + cid;
        if (readingDuration>0){
            url = ServiceDomain.noteDomainWithProtocol+"/pc/note_note/noteDetailLatest/" + cid+"?_from_="+from;
        }
    }else if (data.resourceType=="5"){//网页链接
        url = content.resUrl;
    }else if (data.resourceType=="2"){//期刊
        url = content.appurl;
    }else if (data.resourceType=="0"){//速课
        url = content.url;
    }
    if (!url) {
        //暂不支持打开
        $.toast({type:"failure",content:$.i18n.prop("language.openSupported")});
        return;
    }
    window.open(url);
}

function openCurrentUrl(dom){
	var url=$(dom).attr("targetUrl");
	if(url!=''){
		window.open(url);
	}
}

function openLivePage(liveId){
	$.ajax({
        url: "https://zhibo.chaoxing.com/apis/live/encryptLiveId",
        type: "get",
        dataType:"json",
        data: {"liveIds":liveId},
        success:function(res){
            if(res.result==1){
            	var liveJson=res.data[0];
            	window.open("https://zhibo.chaoxing.com/"+liveJson.encryptLiveId);
            }
        },
        complete:function(){

        },
        error:function(XMLHttpRequest, textStatus){
        }
    });
}

function activeRowKeyUp(obj){
	var keyCode = event.keyCode || event.which;
    if (keyCode == "13") {
        $(obj).trigger("click");
    }
}
/* ]]> */
</script>
</body></html>